#!/bin/bash
#
# 1.创建一个启动service脚本
sudo cp rc-local.service /usr/lib/systemd/system/rc-local.service
# 2.创建 /etc/rc.local 文件
sudo cp rc.local /etc/rc.local
# 3.添加执行权限
sudo chmod a+x /etc/rc.local
# 4.添加/etc/rc.local.d文件夹
sudo mkdir /etc/rc.local.d
# 5.设置开机自启
systemctl enable rc-local